home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Human Interface Toolbox / Live Scroll / BareBones.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.6 KB  |  185 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        BareBones.h
  3.  
  4.     Contains:    Common header file included by all source files
  5.  
  6.     Written by: Chris White    
  7.  
  8.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 8/6/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23.  
  24.  
  25. #ifndef __BAREBONES__
  26. #define __BAREBONES__
  27.  
  28.  
  29.  
  30. // System includes
  31. #ifndef __CONTROLS__
  32.     #include <Controls.h>
  33. #endif
  34.  
  35. #ifndef __QDOFFSCREEN__
  36.     #include <QDOffscreen.h>
  37. #endif
  38.  
  39.  
  40.  
  41. // Application includes
  42. #ifndef __SCROLLBARS__
  43.     #include "ScrollBars.h"
  44. #endif
  45.  
  46.  
  47.  
  48.  
  49. #define DEBUGGING            1            // Anything that shouldn't normally occur
  50. #define WARNINGS            0            // Something that can occur, but you might like to know about
  51.  
  52.  
  53. #define kFourQuestionMarks    0x3F3F3F3F    // C++ compilers that expand trigraphs don't
  54.                                         // like '????'. This should keep them all happy.
  55.  
  56.  
  57. enum
  58. {
  59.     // Generall application stuff
  60.     
  61.     kCreatorCode = kFourQuestionMarks,
  62.     kSleepTime = 60L
  63.  
  64. };
  65.  
  66.  
  67.  
  68. enum
  69. {
  70.     // Menu ID numbers
  71.     
  72.     kMenuBarID = 1000,
  73.     kAppleMenu = 1000,
  74.     kFileMenu = 1001
  75. };
  76.  
  77.  
  78.  
  79. enum
  80. {
  81.     // Apple menu commands
  82.     
  83.     cAbout = 1
  84. };
  85.  
  86.  
  87.  
  88. enum
  89. {
  90.     // File menu commands
  91.     
  92.     cQuit = 1
  93. };
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. enum
  101. {
  102.     // Error strings
  103.     
  104.     kNeedSystem7 = 1,
  105.     kNeedColorQuickdraw,
  106.     kGenericErrorStr
  107. };
  108.  
  109.  
  110.  
  111. enum
  112. {
  113.     // Windows
  114.     
  115.     kDisplayWindow = 1000,
  116.     kAboutDialog = 1000,
  117.      kErrorDialog
  118. };
  119.  
  120.  
  121.  
  122. enum
  123. {
  124.     // Strings
  125.  
  126.     kErrorStrings = 1000
  127. };
  128.  
  129.  
  130.  
  131. enum
  132. {
  133.     // Misc Resources
  134.  
  135.     kPictureID = 1000,
  136.     kScrollBar = 1000
  137. };
  138.  
  139.  
  140.  
  141. enum
  142. {
  143.     // Misc constants
  144.  
  145.     kNoFlags = 0
  146. };
  147.  
  148.  
  149.  
  150.  
  151. struct WindowInfo
  152. {
  153.     ControlRef    hScrollBar;
  154.     ControlRef    vScrollBar;
  155.     GWorldPtr    offscreen;
  156. };
  157.  
  158. typedef struct WindowInfo tWindowInfo, *tWindowInfoPtr;
  159.  
  160.  
  161.  
  162. // Global Variable Definitions. This allows me to include this file
  163. // in all sources with the extern keyword used in all instances except
  164. // the main source file.
  165.  
  166. #ifdef __MAIN__
  167.     #define    global
  168. #else
  169.     #define    global    extern
  170. #endif
  171.  
  172.  
  173. global    Boolean                    gQuit;                      // quit program flag
  174. global    Boolean                    gInBackground;
  175. global    SInt32                    gSleepTime;
  176.  
  177. global    ControlActionUPP        gScrollControlActionUPP;
  178. global    IndicatorActionUPP        gScrollThumbActionUPP;
  179.  
  180.  
  181.  
  182.  
  183.  
  184. #endif    // __BAREBONES__
  185.